/**       
 * @{#} ObjectPool.java Create on 2012-3-29 下午12:18:30       
 *       
 * Copyright (c) 2012 by able.       
 */
package __javable.core.util.pool;

import java.util.NoSuchElementException;

/**
 * 
 * 
 * @history <PRE>
 * --------------------------------------------------------- 
 * VERSION       DATE            BY       CHANGE/COMMENT 
 * --------------------------------------------------------- 
 * 1.0           2012-3-29      able         create 
 * ---------------------------------------------------------
 * </PRE>
 * 
 */
public interface ObjectPool<T> {
	
	T borrowObject() throws Exception, NoSuchElementException, IllegalStateException;

	void returnObject(T obj) throws Exception;

	void invalidateObject(T obj) throws Exception;

	void addObject() throws Exception, IllegalStateException, UnsupportedOperationException;

	int getNumIdle() throws UnsupportedOperationException;

	int getNumActive() throws UnsupportedOperationException;

	void clear() throws Exception, UnsupportedOperationException;

	void close() throws Exception;
}
